package org.hoyi.disptachs.model;

import net.sf.json.JsonConfig;

public class JsonLibCtrls {
	
	private static JsonLibCtrls instance;

	public static JsonLibCtrls getInstance() {
		if (instance == null) {
			instance = new JsonLibCtrls();
		}
		return instance;
	}

	public static String[] jsonexestrs = new String[] {
			"_isPersisted","_tableName","_entityComment","firstfield",
			"secondfield","autoCommit","disctrictrl","database",
			"currentDatabase"};
	/**
	 * 转换Entity为Json的时候忽略掉不需要的属性.
	 * 转换例子:
		JSONArray usarr = JSONArray.fromObject(_users, user.getjsonConfig());
	 * @return value
	 */
	public static JsonConfig getjsonConfig() {
		JsonConfig jsonConfig = new JsonConfig();
		jsonConfig.setExcludes(jsonexestrs);
		return jsonConfig;
	}
}
